<?php
require_once '../../konfigurasi.php';
require_once '../../sesi_login.php';

fungsi('umum');

koneksi_buka();

	$id=$_POST['id'];
			$query 	= "select a.kd_pegawai,a.nip,a.nm_lengkap, b.kd_jabatan, b.nm_jabatan, c.nm_pangkat, count(d.kd_pegawai) as jlh from t_pegawai a
						inner join r_jabatan b on a.kd_jabatan = b.kd_jabatan
						inner join r_pangkat c on c.kd_pangkat = a.kd_pangkat
						left join t_p16_jaksa d on d.kd_pegawai = a.kd_pegawai
						where b.kd_jabatan IN(6,7,8,9) and a.kd_pegawai ='$id' group by d.kd_pegawai";
			$result	= mysql_query($query);
			$baris	= mysql_num_rows($result);
	
	while($row=mysql_fetch_array($result)){
		$pangkat = $row['nm_pangkat'];
		$nip	 = $row['nip'];
		$jabatan = $row['nm_jabatan'];
		$perkara = $row['jlh'];
	?>


	<table class="da-table da-detail-view no-border">
		<tbody>
		<tr></tr>

		<?php if($baris>0){ ?>
		
<div id="isi">
		<tr>
			<th>Pangkat</th>
			<td><?php echo $pangkat;?></td>
		</tr>
		<tr>
			<th>NIP</th>
			<td><?php echo $nip; ?></td>
		</tr>
		<tr>
			<th>Jabatan</th>
			<td><?php echo $jabatan; ?></td>
		</tr>
		<tr>
			<th>Beban Perkara</th>
			<td><?php echo $perkara." Perkara"; ?></td>
		</tr>
		
</div> 
		<?php } else { ?>
		<tr>
			<th>Pangkat</th>
			<td></td>
		</tr>
		<tr>
			<th>NIP</th>
			<td></td>
		</tr>
		<tr>
			<th>Jabatan</th>
			<td></td>
		</tr>
		<tr>
			<th>Beban Perkara</th>
			<td></td>
		</tr>
		<?php }  ?>		
		</tbody>
	</table>




<?php
	}
?>

